package com.huluobo.a2107kotlinshopping.demo

import android.content.Context
import androidx.room.Room
import com.huluobo.a2107kotlinshopping.db.AppDatabase

/**
 *  Created by LC on 2023/11/14.
 */
class UserDatabaseUtil {
    companion object {
        private lateinit var userDatabase: UserDatabase;

        fun init(context: Context) {
            userDatabase = Room.databaseBuilder(context, UserDatabase::class.java, "user.db")
                .allowMainThreadQueries()
                .build()
        }

        fun getAppDatabase(): UserDatabase {
            return userDatabase
        }
    }
}